package com.atguigu.gulimall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;

/**
 * @author Zyx
 * @since 2021/6/12 11:01 下午
 */

@Configuration
public class MyRedissonConfig {


    @Bean(name = "redissonClient", destroyMethod = "shutdown")
    RedissonClient redisson() throws IOException {
        Config config = new Config();
        config.useSingleServer().setAddress("redis://10.211.55.12:6379");
        return Redisson.create(config);
    }

}
